<?php
/**
 * User: Eric-Nothing
 * Datetime: 2019/6/24-9:41
 */
namespace App\Connector\Shape;

use App\Connector\ManageShapeInterface;

class Square implements ShapeInterface,ManageShapeInterface
{
    public $length;

    public function __construct($length)
    {
        $this->length = $length;
    }

    //遵循开闭原则来计算面积
    public function area()
    {
        return pow($this->length,2);
    }

    public function cal()
    {
        return $this->area();
    }

}